import Vue from 'vue';
import App from '@/App.vue';
import router from '@/router/index.js';
import TypeNav from '@/components/TypeNav/TypeNav.vue';
import store from '@/store';
import '@/mock/mockServe';
import 'swiper/css/swiper.css'
import carousel from '@/components/carousel/carousel.vue'
import Pagination from '@/components/Pagination/Pagination.vue'
import * as api from '@/api'
import { MessageBox } from 'element-ui'
import lazyLoad from "vue-lazyload"
import img from "@/assets/images/lazyload.jpg"
import "@/plugins/validate"

Vue.config.productionTip = false;
Vue.component('TypeNav', TypeNav);
Vue.component('carousel', carousel)
Vue.component('Pagination', Pagination)

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

Vue.use(lazyLoad, {
  loading: img
})


new Vue({
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$api = api;

  },
  router: router,
  store: store

}).$mount('#app')
